<template>
	<view class="user">
		<Vnav></Vnav>

		<!-- 个人信息 -->
		<view class="heder">
			<view class="heder-img">
				<image
					:src="userInfo.avatarUrl"
					mode="widthFix"></image>
                    
				<view class="bar-class">
					<text>{{userInfo.userName?userInfo.userName:'新用户'}}</text>
					<view>
						<van-tag type="primary">个人签名</van-tag>
						<text class="txt">没有大笑的一天怎么行。</text>
					</view>
				</view>
			</view>
			<van-icon name="arrow" @click="gotoLogin" />
		</view>
		<view class="message">
			<view class="gender">
				<icon class="iconfont icon-xingbienan1"></icon>
			</view>
			<view class="ip">
				广东·广州
			</view>
			<view class="compile">
				编辑质料
			</view>
			<view class="set">
				<icon class="iconfont icon-shezhi"></icon>
			</view>
		</view>
		<!-- 个人内容 -->
		<view class="content">
			<view class="content-flow">
				<view class="content-num">
					<text>100 </text> 笔记
				</view>
				<view class="content-num">
					<text>100 </text> 获赞
				</view>
				<view class="content-num">
					<text>100 </text> 关注
				</view>
				<view class="content-num">
					<text>100 </text> 粉丝
				</view>
			</view>
			<view style="display: flex;justify-content: space-between;padding:20rpx;background: #f5f5f5;">
				<view class="note">
					<view class="note-odd">
						<image
							src="https://img2.baidu.com/it/u=396410746,868086344&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=837"
							mode="widthFix"></image>
						<view class="note-bottom">
							<text>柳神</text>
							<view class="note-heder">
								<view class="username">
									<image class="userImage"
										src="https://img2.baidu.com/it/u=2150157780,1273337055&fm=253&app=120&size=w931&n=0&f=JPEG&fmt=auto?sec=1668445200&t=acdc4110002358f8e40a1c8e0d9f4da4"
										mode="widthFix"></image><text>茶冢</text>
								</view>

								<view class="aixin">
									<icon class="iconfont icon-aixin1"></icon> <text>290</text>
								</view>

							</view>
						</view>
					</view>

					<view class="note-odd">
						<image src="https://pic.rmb.bdstatic.com/bjh/gallery/1e92f59bb20bf1e6555af291defdd558.jpeg"
							mode="widthFix"></image>
						<view class="note-bottom">
							<text>补神教</text>
							<view class="note-heder">
								<view class="username">
									<image class="userImage"
										src="https://img2.baidu.com/it/u=2150157780,1273337055&fm=253&app=120&size=w931&n=0&f=JPEG&fmt=auto?sec=1668445200&t=acdc4110002358f8e40a1c8e0d9f4da4"
										mode="widthFix"></image><text>茶冢</text>
								</view>

								<view class="aixin">
									<icon class="iconfont icon-aixin1"></icon> <text>300</text>
								</view>

							</view>
						</view>
					</view>
				</view>

				<view class="note note-right">
					<view class="note-odd">
						<image
							src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Finews.gtimg.com%2Fnewsapp_bt%2F0%2F14725034647%2F1000&refer=http%3A%2F%2Finews.gtimg.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1670936243&t=80b0a0a780260ce2924dfc66d98d0d12"
							mode="widthFix"></image>
						<view class="note-bottom">
							<text>火国公主</text>
							<view class="note-heder">
								<view class="username">
									<image class="userImage"
										src="https://img2.baidu.com/it/u=2150157780,1273337055&fm=253&app=120&size=w931&n=0&f=JPEG&fmt=auto?sec=1668445200&t=acdc4110002358f8e40a1c8e0d9f4da4"
										mode="widthFix"></image><text>茶冢</text>
								</view>

								<view class="aixin">
									<icon class="iconfont icon-aixin1"></icon> <text>30</text>
								</view>

							</view>
						</view>
					</view>

					<view class="note-odd">
						<image
							src="https://img0.baidu.com/it/u=3619044464,2761697886&fm=253&fmt=auto&app=120&f=PNG?w=1037&h=568"
							mode="widthFix"></image>
						<view class="note-bottom">
							<text>幼年石昊</text>
							<view class="note-heder">
								<view class="username">
									<image class="userImage"
										src="https://img2.baidu.com/it/u=2150157780,1273337055&fm=253&app=120&size=w931&n=0&f=JPEG&fmt=auto?sec=1668445200&t=acdc4110002358f8e40a1c8e0d9f4da4"
										mode="widthFix"></image><text>茶冢</text>
								</view>

								<view class="aixin">
									<icon class="iconfont icon-aixin1"></icon> <text>942</text>
								</view>

							</view>
						</view>
					</view>
				</view>


			</view>
		</view>
	</view>
</template>

<script>
	import Vnav from "../../components/nav/v-nav.vue"

	export default {
		components: {
			Vnav: Vnav
		},
		data() {
			return {
             userInfo:{}
			}
		},
		onLoad() {
	

			let userInfoVal = uni.getStorageSync("userInfo")
			if(userInfoVal){
				this.userInfo = userInfoVal
			}else{
				uni.reLaunch({
					url:'./login'
				})
				// uni.showModal({
				// 	title: '登录提示',
				// 	content: '为了不影响部分功能的使用,建议先登录再使用！',
				// 	success: function (res) {
				// 		if (res.confirm) {
				// 			uni.reLaunch({
				// 				url:'./login'
				// 			})
				// 		} else if (res.cancel) {
				// 			uni.reLaunch({
				// 				url:'../index/index'
				// 			})
				// 		}
				// 	}
				// });
				
			}
				// uni.login({
				// 				provider:'weixin',
				// 				success: res => {
				// 					// 把返回的参数存入变量
				// 					console.log(res)
				// 				},
				// 			})
		},
		onShow() {
			
		},
		methods: {
			gotoLogin(){
				uni.navigateTo({
					url:"./login"
				})
			},

	
		}
	}
</script>

<style lang="scss" scoped>
	.user {
		position: relative;
		background-color: #f5f5f5;

		.heder {
			width: 95%;
			position: absolute;
			top: 226rpx;
			left: 20rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;

			.heder-img {
				display: flex;
				align-items: center;

				image {
					border: 4rpx solid #FFFFFF;
					width: 80rpx;
					height: 80rpx;
					border-radius: 44rpx;
				}

				.bar-class {
					margin-left: 20rpx;

					text:nth-child(1) {
						font-size: 32rpx;
						font-weight: bold;
						margin-bottom: 10rpx;
					}

					view:nth-child(2) {
						color: #333333;
						font-size: 28rpx;
						display: flex;
						align-items: center;

						.txt {
							width: 400rpx;
							display: inline-block;
							white-space: nowrap;
							overflow: hidden;
							text-overflow: ellipsis;
							margin-left: 20rpx;
						}
					}
				}

			}

		}

		.message {
			width: 95%;
			position: absolute;
			top: 324rpx;
			left: 20rpx;
			display: flex;
			font-size: 24rpx;
			color: #000;
			align-items: center;

			.gender {
				border-radius: 10rpx;
				padding: 2rpx 10rpx;

				background-color: rgba(255, 255, 255, 0.2);
				border: 2rpx solid #FFFFFF;
				margin-right: 20rpx;

			}

			.ip {
				border-radius: 10rpx;
				padding: 2rpx 20rpx;
				background-color: rgba(255, 255, 255, 0.2);
				border: 2rpx solid #FFFFFF;
			}

			.compile {
				border-radius: 10rpx;
				padding: 2rpx 20rpx;
				background-color: rgba(255, 255, 255, 0.2);
				border: 2rpx solid #FFFFFF;
				margin-left: 280rpx;
				margin-right: 20rpx;

			}

			.set {
				border-radius: 10rpx;
				padding: 2rpx 10rpx;
				background-color: rgba(255, 255, 255, 0.2);
				border: 2rpx solid #FFFFFF;
			}
		}

		.content {
			// border-radius: 20rpx 20rpx 0 0;
			position: absolute;
			top: 394rpx;
			width: 100%;

			.content-flow {
				background-color: #FFFFFF;
				padding-top: 20rpx;
				border-radius: 20rpx 20rpx 0 0;
				box-sizing: border-box;
				display: flex;
				justify-content: center;
				border-bottom: 2rpx solid #c7c7c7;
				padding-bottom: 20rpx;
				font-size: 28rpx;
				color: #333333;

				.content-num {
					margin-right: 40rpx;

					text:nth-child(1) {
						font-weight: bold;
						margin-right: 6rpx;
					}
				}
			}

			.note {
				background-color: #f5f5f5;
				box-sizing: border-box;
				padding-bottom: 480rpx;

				.note-odd {
					display: flex;
					flex-direction: column;
					flex-wrap: wrap;
					margin-bottom: 20rpx;
					border-radius: 0 0 10rpx 10rpx;
					background-color: #FFFFFF;

					image {
						width: 350rpx;
						max-height: 400rpx;
						border-radius: 10rpx 10rpx 0 0;
					}

					.note-bottom {
						padding: 10rpx 6rpx 10rpx 6rpx;

						box-sizing: border-box;
						width: 100%;
						font-size: 24rpx;
						color: #999999;

						text:nth-child(1) {
							color: #333333;
							display: inline-block;
							font-weight: bold;
							padding-bottom: 10rpx;
						}

						.note-heder {
							border-radius: 0 0 10rpx 10rpx;
							display: flex;
							align-items: center;
							justify-content: space-between;

							.username {
								display: flex;
								align-items: center;

								.userImage {
									width: 40rpx;
									height: 40rpx;
									border-radius: 20rpx;
									margin-right: 10rpx;
								}
							}

							.aixin {
								display: flex;
							}
						}
					}
				}
			}

			.note-right {
				padding-right: 0rpx;
			}
		}
	}
</style>
